#include <stdio.h>
#include <stdlib.h>

int main()
{
    //开辟二级指针对应的堆空间
    int **p = (int **)malloc(sizeof(int *) * 5);
    for (int i = 0; i < 5; i++)
    {
        //*(p+i)
        p[i] = (int *)malloc(sizeof(int) * 3);
    }

    for (int i = 0; i < 5; i++)
    {
        for (int j = 0; j < 3; j++)
        {
            scanf("%d", &p[i][j]);
        }
    }

    for (int i = 0; i < 5; i++)
    {
        for (int j = 0; j < 3; j++)
        {
            printf("%d ", p[i][j]);
            //printf("%d ", *(p[i] + j));
            //printf("%d ", *(*(p + i) + j));
        }
        printf("\n");
    }

    for (int i = 0; i < 5; i++)
    {
        free(p[i]);
    }
    free(p);
}